﻿set(CMAKE_C_COMPILER ${CROSS_COMPILE}gcc)  
set(CMAKE_CXX_COMPILER ${CROSS_COMPILE}g++)  

ADD_DEFINITIONS(-DCONFIG_PATH=\\"${CONFIG_PATH}\\")

cmake_minimum_required (VERSION 2.6)

SET(PROJECTNAME IPCAM)

PROJECT (${PROJECTNAME})

SET(TOP_BINARY_DIR ${${PROJECTNAME}_BINARY_DIR})
SET(TOP_SOURCE_DIR ${${PROJECTNAME}_SOURCE_DIR})

MESSAGE(STATUS "This is config path " ${CONFIG_PATH})
MESSAGE(STATUS "This is BINARY dir " ${IPCAM_BINARY_DIR})
MESSAGE(STATUS "This is SOURCE dir " ${IPCAM_SOURCE_DIR})
MESSAGE(STATUS "BOARD is " ${BOARD})
MESSAGE(STATUS "CROSS_COMPILE is " ${CROSS_COMPILE})

#set(CMAKE_INSTALL_PREFIX ${PROJECT_BINARY_DIR})
SET(CMAKE_INSTALL_PREFIX $ENV{HOME}/jovision/progs-${BOARD})

ADD_DEFINITIONS(-DPLATFORM_${BOARD} -Wall -Wno-unused)
ADD_DEFINITIONS(-g -O0)
MESSAGE(STATUS "Platform Macro define: " -DPLATFORM_${BOARD})

SET(OPENSSL_ENABLE ON)

if (OPENSSL_DISABLE)
	SET(OPENSSL_ENABLE OFF)
endif()

if (TINY_ONVIF_SUPPORT)
	ADD_DEFINITIONS(-DTINY_ONVIF_SUPPORT)
    SET(LIVE555_SUPPORT ON)
endif()

if (ZRTSP_SUPPORT)
	ADD_DEFINITIONS(-DZRTSP_SUPPORT)
	SET(LIVE555_SUPPORT OFF)
endif()

if (LIVE555_SUPPORT)
	ADD_DEFINITIONS(-DLIVE555_SUPPORT)
endif()

if (SOUND_WAVE_DEC_SUPPORT)
	ADD_DEFINITIONS(-DSOUND_WAVE_DEC_SUPPORT)
endif()

if (GB28181_SUPPORT)
	ADD_DEFINITIONS(-DGB28181_SUPPORT)
endif()

if (TUYA_SUPPORT)
	ADD_DEFINITIONS(-DTUYA_SUPPORT)
endif()

if (SD_RECORD_SUPPORT) 
	ADD_DEFINITIONS(-DSD_RECORD_SUPPORT)
endif()

if(BIZ_CLIENT_SUPPORT)
	ADD_DEFINITIONS(-DBIZ_CLIENT_SUPPORT)
endif()

if(WEB_SUPPORT)
	ADD_DEFINITIONS(-DWEB_SUPPORT)
endif()

if(OBSS_CLOUDSTORAGE)
	ADD_DEFINITIONS(-DOBSS_CLOUDSTORAGE)
endif()

if (FIRMUP_BY_MEDIAMEM)
	ADD_DEFINITIONS(-DFIRMUP_BY_MEDIAMEM) 
endif()

if (YST_SVR_SUPPORT)
	ADD_DEFINITIONS(-DYST_SVR_SUPPORT)
endif()

if (XW_MMVA_SUPPORT)
	ADD_DEFINITIONS(-DXW_MMVA_SUPPORT)
endif()

#share作为功能共享目录，全工程开放
INCLUDE_DIRECTORIES(share/network)
#INCLUDE_DIRECTORIES(share/cJSON)
INCLUDE_DIRECTORIES(share/ptz)
INCLUDE_DIRECTORIES(share/utility)
INCLUDE_DIRECTORIES(share/smtp)
INCLUDE_DIRECTORIES(share/nl80211)
INCLUDE_DIRECTORIES(share/rtmp)
INCLUDE_DIRECTORIES(share/mp4)

ADD_SUBDIRECTORY(share/network)
#ADD_SUBDIRECTORY(share/cJSON)
ADD_SUBDIRECTORY(share/ptz)
ADD_SUBDIRECTORY(share/utility)
ADD_SUBDIRECTORY(share/smtp)
ADD_SUBDIRECTORY(share/nl80211)
ADD_SUBDIRECTORY(porting/${BOARD})
ADD_SUBDIRECTORY(module)
ADD_SUBDIRECTORY(server/osd_server)
ADD_SUBDIRECTORY(server/weber)
ADD_SUBDIRECTORY(server/sctrl)
ADD_SUBDIRECTORY(server/sport)
ADD_SUBDIRECTORY(libs)

if(TUYA_SUPPORT)
	ADD_SUBDIRECTORY(server/tuya)
endif()

if (YST_SVR_SUPPORT)
	ADD_SUBDIRECTORY(server/yst_svr)
endif()

if(GB28181_SUPPORT)
	ADD_SUBDIRECTORY(server/gb28181)
endif()

